/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package maincz.tests.webapp.service;

import java.util.List;
import java.util.logging.Logger;
import maincz.tests.webapp.dao.ICachesDAO;
import maincz.tests.webapp.entity.Cache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author Main
 */
@Service
public class CachesService implements ICachesService {

    @Autowired
    private ICachesDAO cacheDao;

    private static final Logger log = Logger.getLogger("MyLogger");

    public CachesService() {
        super();
        log.info("constructor ContactServiceImpl");
    }

    @Override
    @Transactional
    public void addOrUpdateCache(Cache cache) {
        this.cacheDao.addOrUpdate(cache);
    }

    @Override
    @Transactional
    public List<Cache> listCaches() {
        return this.cacheDao.listCaches();
    }

    @Override
    @Transactional
    public void removeCache(String geocode) {
        this.cacheDao.removeCache(geocode);
    }

    public ICachesDAO getCacheDao() {
        return cacheDao;
    }

    public void setCacheDao(ICachesDAO cacheDao) {
        this.cacheDao = cacheDao;
    }    

}
